<script>
if (window.testRunner) {
    testRunner.dumpEditingCallbacks();
    testRunner.dumpAsLayoutWithPixelResults();
}
</script>
<p>This tests to see if Find will get stuck when searching for a word that is currently selected, and was selected with a double click.</p>

<div>foo <span id="selectme">bar</span> baz foo bar baz</div>

<script>
if (window.testRunner) {
    var e = document.getElementById("selectme");
    var x = e.offsetLeft + e.offsetWidth / 2;
    var y = e.offsetTop + e.offsetHeight / 2;
    eventSender.mouseMoveTo(x, y);
    eventSender.mouseDown();
    eventSender.mouseUp();
    eventSender.mouseDown();
    eventSender.mouseUp();
    
    document.execCommand("FindString", false, "bar");
}
</script>
